Training distilled machine learning models

ABSTRACT

Methods, systems, and apparatus, including computer programs encoded on computer storage media, for training a distilled machine learning model. One of the methods includes training a cumbersome machine learning model, wherein the cumbersome machine learning model is configured to receive an input and generate a respective score for each of a plurality of classes; and training a distilled machine learning model on a plurality of training inputs, wherein the distilled machine learning model is also configured to receive inputs and generate scores for the plurality of classes, comprising: processing each training input using the cumbersome machine learning model to generate a cumbersome target soft output for the training input; and training the distilled machine learning model to, for each of the training inputs, generate a soft output that matches the cumbersome target soft output for the training input.

CROSS-REFERENCE TO RELATED APPLICATION

This is a continuation application of, and claims priority to, U.S.patent application Ser. No. 16/368,526, titled “TRAINING DISTILLEDMACHINE LEARNING MODELS,” filed on Mar. 28, 2019, which applicationclaims priority to, U.S. patent application Ser. No. 14/731,349, titled“TRAINING DISTILLED MACHINE LEARNING MODELS,” filed on Jun. 4, 2015,which application claims priority to U.S. Provisional Application No.62/008,998, filed on Jun. 6, 2014. The disclosure of the priorapplications are considered part of and are incorporated by reference inthe disclosure of this application.

BACKGROUND

This specification relates to training machine learning models.

A machine learning model receives input and generates an output based onthe received input and on values of the parameters of the model. Forexample, machine learning models may receive an image and generate ascore for each of a set of classes, with the score for a given classrepresenting a probability that the image contains an image of an objectthat belongs to the class.

The machine learning model may be composed of, e.g., a single level oflinear or non-linear operations or may be a deep network, i.e., amachine learning model that is composed of multiple levels, one or moreof which may be layers of non-linear operations. An example of a deepnetwork is a neural network with one or more hidden layers.

SUMMARY

In general, this specification describes techniques for training adistilled machine learning model using a cumbersome machine learningmodel.

Particular embodiments of the subject matter described in thisspecification can be implemented so as to realize one or more of thefollowing advantages. A distilled machine learning model that is easierto deploy than a cumbersome machine learning model, i.e., because itrequires less computation, memory, or both, to generate outputs at runtime than the cumbersome machine learning model, can effectively betrained using a cumbersome neural network that has already been trained.Once trained using the cumbersome machine learning model, the distilledmachine learning model can generate outputs that are not significantlyless accurate than outputs generated by the cumbersome machine learningmodel despite being easier to deploy or using fewer computationalresources than the cumbersome machine learning model.

An ensemble model that includes one or more full machine learning modelsand one or more specialist machine learning models can more accuratelygenerate scores to classify a received input. In particular, byincluding specialist machine learning models in the ensemble model, thescores for classes that are frequently predicted together or confused bythe full machine learning models can be more accurately generated.

The details of one or more embodiments of the subject matter of thisspecification are set forth in the accompanying drawings and thedescription below. Other features, aspects, and advantages of thesubject matter will become apparent from the description, the drawings,and the claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows an example distilled machine learning model trainingsystem.

FIG. 2 is a flow diagram of an example process for training a distilledmachine learning model using a trained cumbersome machine learningmodel.

FIG. 3 shows an example machine learning model system.

FIG. 4 is a flow diagram of an example process for processing an inputusing an ensemble machine learning model that includes one or more fullmachine learning models and one or more specialist machine learningmodels.

Like reference numbers and designations in the various drawings indicatelike elements.

DETAILED DESCRIPTION

FIG. 1 is a block diagram of an example distilled machine learning modeltraining system 100 for training a distilled machine learning model 120.The distilled machine learning model training system 100 is an exampleof a system implemented as computer programs on one or more computers inone or more locations, in which the systems, components, and techniquesdescribed below are implemented.

The distilled machine learning model training system 100 trains thedistilled machine learning model 120 using a trained cumbersome machinelearning model 110. Generally, a machine learning model receives inputand generates an output based on the received input and on values of theparameters of the model.

In particular, both the distilled machine learning model 120 and thetrained cumbersome machine learning model 110 are machine learningmodels that have been configured to receive an input and to process thereceived input to generate a respective score for each class in apredetermined set of classes. Generally, the distilled machine learningmodel 120 is a model that has a different architecture from thecumbersome machine learning model 110 that makes it easier to deploythan the cumbersome machine learning model 110, e.g., because thedistilled machine learning model 120 requires less computation, memory,or both, to generate outputs at run time than the cumbersome machinelearning model 110. For example, the distilled machine learning model120 may have fewer layers, fewer parameters, or both than the cumbersomemachine learning model 110.

The trained cumbersome machine learning model 110 has been trained on aset of training inputs using a conventional machine learning trainingtechnique to determine trained values of the parameters of thecumbersome machine learning model 110. In particular, the trainedcumbersome machine learning model 110 has been trained so that the scoregenerated by the trained cumbersome machine learning model 110 for agiven class for a given input represents the probability that the classis an accurate classification of the input.

For example, if the inputs to the cumbersome machine learning model 110are images, the score for a given class may represent a probability thatthe input image contains an image of an object that belongs to theclass. As another example, if the inputs to the cumbersome machinelearning model 110 are text segments, the classes may be topics, and thescore for a given topic may represent a probability that the input textsegment relates to the topic.

In some cases, the cumbersome machine learning model 110 is a singlemachine learning model. In some other cases, the cumbersome machinelearning model 110 is an ensemble machine learning model that is acompilation of multiple individual machine learning models that havebeen trained separately, with the outputs of the individual machinelearning models being combined to generate the output of the cumbersomemachine learning model 110. Further, in some cases, the models in theensemble machine learning model include one or more full models thatgenerate scores for each of the classes and one or more specialistmodels that generate scores for only a respective subset of the classes.An ensemble machine learning model that includes one or more full modelsand one or more specialist models is described in more detail below withreference to FIGS. 3 and 4.

The model training system 100 trains the distilled machine learningmodel 120 on a set of training inputs in order to determine trainedvalues of the parameters of the distilled machine learning model 120 sothat the score generated by the distilled machine learning model 120 fora given class for a given input also represents the probability that theclass is an accurate classification of the input.

In particular, to train the distilled machine learning model 120, themodel training system 100 configures both the distilled machine learningmodel 120 and the cumbersome machine learning model 110 to, duringtraining of the distilled machine learning model 120, generate softoutputs from training inputs.

A soft output of a machine learning model for a given input includes arespective soft score for each of the classes that is generated by thelast layer of the machine learning model. The soft scores define asofter score distribution over the set of classes for the input thanscores generated by the machine learning model for the input after themachine learning model has been trained.

In particular, in some implementations, the last layer of both thedistilled machine learning model 120 and the cumbersome machine learningmodel 110 is a softmax layer that generates a score q_(i) for a givenclass i that satisfies:

$q_{i} = \frac{\exp\left( \frac{z_{i}}{T} \right)}{\sum\limits_{j}{\exp\left( \frac{z_{j}}{T} \right)}}$where z_(i) is a weighted combination of the outputs of a previous layerof the machine learning model for the class i received by the lastlayer, j ranges from 1 to a total number of classes, and T is atemperature constant. In these implementations, the model trainingsystem 100 configures both the distilled machine learning model 120 andthe cumbersome machine learning model 110 to generate soft outputs bysetting T to a higher value than used for T to generate scores after themachine learning model has been trained. For example, after training,the value of T for the distilled machine learning model 120 can be setequal to 1 while, during training, the value of T can be set equal to20. The cumbersome machine learning model 110 and the distilled machinelearning model 120 use the same value of T to generate soft outputsduring training of the distilled machine learning model 120.

Thus, a soft output of a machine learning model is an output of themodel using current values of the parameters, but with the value of Tfor the last layer of the model being increased to a value that isgreater than the value used to generate outputs after the model has beentrained, e.g., increased to a value that is greater than 1.

During the training, the model training system 100 processes eachtraining input, e.g., a training input 102, using the cumbersome machinelearning model 110 to generate a cumbersome target soft output for thetraining input, e.g., a cumbersome target soft output 112 for thetraining input 102. The model training system 100 also processes thetraining input using the distilled machine learning model 120 togenerate a distilled soft output for the training input, e.g., adistilled soft output 132 for the training input 102. The model trainingsystem 100 then trains the distilled machine learning model 120 togenerate soft outputs that match the cumbersome target soft outputs forthe training inputs by adjusting the values of the parameters of thedistilled machine learning model 120. Training the distilled machinelearning model 120 is described in more detail below with reference toFIG. 2.

FIG. 2 is a flow diagram of an example process 200 for training adistilled machine learning model. For convenience, the process 200 willbe described as being performed by a system of one or more computerslocated in one or more locations. For example, a model training system,e.g., the model training system 100 of FIG. 1, appropriately programmed,can perform the process 200.

The system trains a cumbersome machine learning model, e.g., thecumbersome machine learning model 110 of FIG. 1, to determine trainedvalues of the parameters of the cumbersome machine learning model usingconventional machine learning training techniques (step 202). Inparticular, the system trains the cumbersome machine learning model on aset of training inputs to process an input to effectively generate arespective score for each class in a predetermined set of classes.

The system receives training data for training a distilled machinelearning model, e.g., the distilled machine learning model 120 of FIG. 1(step 204). The training data includes a set of training inputs that maybe the same training inputs used to train the cumbersome machinelearning model or different training inputs from the training inputsused to train the cumbersome machine learning model.

The system processes each training input in the set of training inputsusing the trained cumbersome machine learning model to determine arespective cumbersome target soft output for the training input (step206). As described above, a soft output includes a respective soft scorefor each of the classes. The soft scores for a given training inputdefine a softer score distribution over the set of classes for the inputthan scores generated by the machine learning model for the input afterthe machine learning model has been trained.

The system trains the distilled machine learning model to generatedistilled soft outputs for the training inputs that match the cumbersometarget soft outputs for the training input (step 208).

In particular, for a given training input, the system processes thetraining input using the distilled machine learning model to generate adistilled soft output for the training input in accordance with currentvalues of the parameters of the distilled machine learning model. Thesystem then determines an error between the cumbersome target softoutput for the training input and the distilled soft output for thetraining input. The system then uses the error to adjust the values ofthe parameters of the distilled machine learning model, e.g., usingconventional machine learning training techniques. For example, if thedistilled machine learning model is a deep neural network, the systemcan use a gradient descent with backpropagation technique to adjust thevalues of the parameters of the distilled machine learning model.

Optionally, the system can also train the distilled machine learningmodel using hard targets for the training input. A hard target for atraining input is a set of scores that includes a 1 for each correct orknown class for the training input, i.e., each class that the traininginput should be classified into by the distilled machine learning model,and a 0 for each other class. In particular, the system can determineone error between the cumbersome target soft output for the traininginput and the distilled soft output for the training input and anothererror between the hard target for the training input and a distilledunsoftened output for the training input. The unsoftened output is a setof scores generated for the training input by the distilled machinelearning model using the temperature that will be used after the modelis trained. The system can then use both errors to adjust the values ofthe parameters of the distilled machine learning model usingconventional machine learning training techniques, e.g., bybackpropagating gradients computed using both errors through the layersof the distilled machine learning model.

FIG. 3 shows an example machine learning model system 300. The machinelearning model system 300 is an example of a system implemented ascomputer programs on one or more computers in one or more locations, inwhich the systems, components, and techniques described below areimplemented.

The machine learning model system 300 processes inputs, e.g., an input304, using an ensemble machine learning model 302 to generate arespective score for each class in a predetermined set of classes 312.

The ensemble machine learning model 302 is an ensemble machine learningmodel that includes one or more specialist machine learning models,e.g., a specialist machine learning model 320 and a specialist machinelearning model 330, and one or more full machine learning models, e.g.,a full machine learning model 310. Each of the machine learning modelsin the ensemble machine learning model 302 has been trained separatelyto generate scores that represent probabilities, e.g., usingconventional machine learning training techniques.

Each full machine learning model is configured to process an input,e.g., the input 304, generate a respective score for each class in thepredetermined set of classes 312. While only one full machine learningmodel 310 is illustrated in the example of FIG. 3, the ensemble machinelearning model 302 can include multiple full machine learning modelsthat each process the input 304 to generate a respective set of scoresfor the input, with each set including a respective score for each ofthe classes.

Each specialist machine learning model, however, is configured togenerate a respective score for only a subset of the classes in the setof classes 312. In the example of FIG. 3, the specialist machinelearning model 320 is configured to generate scores for a subset 322 ofthe set of classes 312 while the specialist machine learning model 330is configured to generate scores for a subset 332 of the set of classes312. In some implementations, each specialist machine learning model mayalso be configured to generate a score for a dustbin class, i.e., anaggregate of all of the classes not included in the subset for thespecialist machine learning model.

To generate the final scores for the set of classes for the input 304,the machine learning model system 300 processes the input using eachfull machine learning model to determine an initial set of scores forthe input 304. The machine learning model system 300 then determines,from the initial scores for the input 304, whether or not to includescores generated by any of the specialist machine learning models in thefinal scores for the input 302. Processing an input to generate a set offinal scores for the input is described in more detail below withreference to FIG. 4.

In some cases, the machine learning model system 300 selects the subsetsthat are assigned to each specialist model by selecting the subsets suchthat classes that are frequently predicted together by the full machinelearning models are included in the same subset. That is, the machinelearning model system 300 can select the subsets such that classes thatare frequently scored similarly by the full machine learning models areassigned to the same subset.

In particular, the machine learning model system 300 can generate acovariance matrix of scores generated by the full models, i.e., theinitial scores as described below with reference to FIG. 4, for a set ofinputs processed by the full models. The machine learning model system300 can then apply a clustering technique, e.g., a K-means clusteringtechnique, to the columns of the covariance matrix to cluster theclasses, with each cluster being assigned as the subset of one or morespecialists. The machine learning model system 300 can then train eachspecialist machine learning model to effectively generate scores for thesubset of classes assigned to the specialist and, optionally, for thedustbin class.

FIG. 4 is a flow diagram of an example process 400 for processing aninput using an ensemble machine learning model that includes one or morefull machine learning models and one or more specialist machine learningmodels. For convenience, the process 400 will be described as beingperformed by a system of one or more computers located in one or morelocations. For example, a machine learning model system, e.g., themachine learning model system 300 of FIG. 3, appropriately programmed,can perform the process 400.

The system processes the input using each full machine learning model togenerate a respective set of full scores for each full machine learningmodel (step 402). Each set of full scores includes a respective fullscore for each class in the set of classes.

The system combines the full scores to generate initial scores for theinput (step 404). For example, the system can combine the full scoresby, for each class, taking an arithmetic or geometric mean of each fullscore generated for the class across the full models. If there are notspecialist models in the ensemble machine learning model, the systemuses the initial scores as the final scores for the input.

If there are specialist models in the ensemble machine learning model,the system selects classes for which the initial score is high enough(step 406). The system can determine that the initial score is highenough for each class having a score that exceeds a threshold score oreach class having a score that is in a threshold number of highestscores.

The system processes the input using each specialist machine learningmodel that is assigned a subset of classes that includes at least one ofthe selected classes to generate a respective set of specialist scoresfor the input (step 408). In some implementations, the system processesthe input using each of the specialist machine learning models and thenonly uses the scores generated by the specialist machine learning modelsthat are assigned a subset of classes that includes at least one of theselected classes. In some other implementations, after the classes havebeen selected, the system processes the input only using the specialistmachine learning models that are assigned a subset of classes thatincludes at least one of the selected classes.

The system combines the initial scores with the specialist scores togenerate the final scores for the input (step 410). For example, thesystem can combine the scores by, for each class, taking an arithmeticor geometric mean of the initial score generated for the class and thespecialist scores generated for the class. As another example, thesystem can combine the scores by, for each class, taking an arithmeticor geometric mean of the full scores generated for the class and thespecialist scores generated for the class.

When the ensemble machine learning model is the cumbersome machinelearning mode that is used for training a distilled machine learningmodel as described above with reference to FIGS. 1 and 2, the systemsets the temperature to the same higher value for each model in theensemble machine learning model and then performs the process 400 togenerate the cumbersome target soft output for a given training input.In some implementations, the system performs the process 400 for thetraining input to generate an unsoftened cumbersome output for thetraining input and then generates the cumbersome target soft output byadjusting the unsoftened cumbersome output in accordance with the highertemperature value.

The description above describes implementations where the temperaturevalue is a constant value. However, in some other implementations, thetemperature value can vary during the process of training the distilledmachine learning model. For example, the temperature value can begradually increased during the training process, e.g., after eachtraining iteration. As another example, the temperature value can begradually decreased during the training process, e.g., after eachtraining iteration.

Embodiments of the subject matter and the functional operationsdescribed in this specification can be implemented in digital electroniccircuitry, in tangibly-embodied computer software or firmware, incomputer hardware, including the structures disclosed in thisspecification and their structural equivalents, or in combinations ofone or more of them. Embodiments of the subject matter described in thisspecification can be implemented as one or more computer programs, i.e.,one or more modules of computer program instructions encoded on atangible non transitory program carrier for execution by, or to controlthe operation of, data processing apparatus. Alternatively or inaddition, the program instructions can be encoded on an artificiallygenerated propagated signal, e.g., a machine-generated electrical,optical, or electromagnetic signal, that is generated to encodeinformation for transmission to suitable receiver apparatus forexecution by a data processing apparatus. The computer storage mediumcan be a machine-readable storage device, a machine-readable storagesubstrate, a random or serial access memory device, or a combination ofone or more of them.

The term “data processing apparatus” encompasses all kinds of apparatus,devices, and machines for processing data, including by way of example aprogrammable processor, a computer, or multiple processors or computers.The apparatus can include special purpose logic circuitry, e.g., an FPGA(field programmable gate array) or an ASIC (application specificintegrated circuit). The apparatus can also include, in addition tohardware, code that creates an execution environment for the computerprogram in question, e.g., code that constitutes processor firmware, aprotocol stack, a database management system, an operating system, or acombination of one or more of them.

A computer program (which may also be referred to or described as aprogram, software, a software application, a module, a software module,a script, or code) can be written in any form of programming language,including compiled or interpreted languages, or declarative orprocedural languages, and it can be deployed in any form, including as astandalone program or as a module, component, subroutine, or other unitsuitable for use in a computing environment. A computer program may, butneed not, correspond to a file in a file system. A program can be storedin a portion of a file that holds other programs or data, e.g., one ormore scripts stored in a markup language document, in a single filededicated to the program in question, or in multiple coordinated files,e.g., files that store one or more modules, sub programs, or portions ofcode. A computer program can be deployed to be executed on one computeror on multiple computers that are located at one site or distributedacross multiple sites and interconnected by a communication network.

The processes and logic flows described in this specification can beperformed by one or more programmable computers executing one or morecomputer programs to perform functions by operating on input data andgenerating output. The processes and logic flows can also be performedby, and apparatus can also be implemented as, special purpose logiccircuitry, e.g., an FPGA (field programmable gate array) or an ASIC(application specific integrated circuit).

Computers suitable for the execution of a computer program include, byway of example, can be based on general or special purposemicroprocessors or both, or any other kind of central processing unit.Generally, a central processing unit will receive instructions and datafrom a read only memory or a random access memory or both. The essentialelements of a computer are a central processing unit for performing orexecuting instructions and one or more memory devices for storinginstructions and data. Generally, a computer will also include, or beoperatively coupled to receive data from or transfer data to, or both,one or more mass storage devices for storing data, e.g., magnetic,magneto optical disks, or optical disks. However, a computer need nothave such devices. Moreover, a computer can be embedded in anotherdevice, e.g., a mobile telephone, a personal digital assistant (PDA), amobile audio or video player, a game console, a Global PositioningSystem (GPS) receiver, or a portable storage device, e.g., a universalserial bus (USB) flash drive, to name just a few.

Computer readable media suitable for storing computer programinstructions and data include all forms of nonvolatile memory, media andmemory devices, including by way of example semiconductor memorydevices, e.g., EPROM, EEPROM, and flash memory devices; magnetic disks,e.g., internal hard disks or removable disks; magneto optical disks; andCD ROM and DVD-ROM disks. The processor and the memory can besupplemented by, or incorporated in, special purpose logic circuitry.

To provide for interaction with a user, embodiments of the subjectmatter described in this specification can be implemented on a computerhaving a display device, e.g., a CRT (cathode ray tube) or LCD (liquidcrystal display) monitor, for displaying information to the user and akeyboard and a pointing device, e.g., a mouse or a trackball, by whichthe user can provide input to the computer. Other kinds of devices canbe used to provide for interaction with a user as well; for example,feedback provided to the user can be any form of sensory feedback, e.g.,visual feedback, auditory feedback, or tactile feedback; and input fromthe user can be received in any form, including acoustic, speech, ortactile input. In addition, a computer can interact with a user bysending documents to and receiving documents from a device that is usedby the user; for example, by sending web pages to a web browser on auser's client device in response to requests received from the webbrowser.

Embodiments of the subject matter described in this specification can beimplemented in a computing system that includes a back end component,e.g., as a data server, or that includes a middleware component, e.g.,an application server, or that includes a front end component, e.g., aclient computer having a graphical user interface or a Web browserthrough which a user can interact with an implementation of the subjectmatter described in this specification, or any combination of one ormore such back end, middleware, or front end components. The componentsof the system can be interconnected by any form or medium of digitaldata communication, e.g., a communication network. Examples ofcommunication networks include a local area network (“LAN”) and a widearea network (“WAN”), e.g., the Internet.

The computing system can include clients and servers. A client andserver are generally remote from each other and typically interactthrough a communication network. The relationship of client and serverarises by virtue of computer programs running on the respectivecomputers and having a client-server relationship to each other.

While this specification contains many specific implementation details,these should not be construed as limitations on the scope of anyinvention or of what may be claimed, but rather as descriptions offeatures that may be specific to particular embodiments of particularinventions. Certain features that are described in this specification inthe context of separate embodiments can also be implemented incombination in a single embodiment. Conversely, various features thatare described in the context of a single embodiment can also beimplemented in multiple embodiments separately or in any suitablesubcombination. Moreover, although features may be described above asacting in certain combinations and even initially claimed as such, oneor more features from a claimed combination can in some cases be excisedfrom the combination, and the claimed combination may be directed to asubcombination or variation of a subcombination.

Similarly, while operations are depicted in the drawings in a particularorder, this should not be understood as requiring that such operationsbe performed in the particular order shown or in sequential order, orthat all illustrated operations be performed, to achieve desirableresults. In certain circumstances, multitasking and parallel processingmay be advantageous. Moreover, the separation of various system modulesand components in the embodiments described above should not beunderstood as requiring such separation in all embodiments, and itshould be understood that the described program components and systemscan generally be integrated together in a single software product orpackaged into multiple software products.

Particular embodiments of the subject matter have been described. Otherembodiments are within the scope of the following claims. For example,the actions recited in the claims can be performed in a different orderand still achieve desirable results. As one example, the processesdepicted in the accompanying figures do not necessarily require theparticular order shown, or sequential order, to achieve desirableresults. In certain implementations, multitasking and parallelprocessing may be advantageous.

What is claimed is:
 1. A method performed by one or more data processingapparatus for training a student machine learning model having aplurality of student model parameters on a set of multiple traininginputs, wherein the student machine learning model is configured toprocess an input to generate an output that comprises a respective scorefor each of a plurality of classes, the method comprising: processingeach training input of the set of multiple training inputs using ateacher machine learning model to generate a target output for thetraining input, wherein the target output comprises a respective targetscore for each of the plurality of classes, wherein each target scoresatisfies:$q_{i}^{t} = \frac{\exp\left( \frac{z_{i}^{t}}{T^{t}} \right)}{\sum\limits_{j}{\exp\left( \frac{z_{j}^{t}}{T^{t}} \right)}}$wherein q_(i) ^(t) is the target score for a class i, z_(i) ^(t) is anintermediate score generated by the teacher machine learning model forclass i, z_(j) ^(t) is an intermediate score generated by the teachermachine learning model for class j, j ranges from 1 to a total number ofclasses in the plurality of classes, and T^(t) is a temperature constanthaving a value that is greater than 1; and training the student machinelearning model to, for each training input of the set of multipletraining inputs, process the training input to generate an output thatmatches the target output generated by the teacher machine learningmodel for the training input.
 2. The method of claim 1, wherein theteacher machine learning model is an ensemble model comprising aplurality of respective baseline machine learning models.
 3. The methodof claim 2, wherein processing a training input using the teachermachine learning model to generate a target output for the traininginput comprises: processing the training input using each baselinemachine learning model to generate a baseline output for the traininginput; and combining the baseline outputs for the training inputs togenerate the target output for the training input.
 4. The method ofclaim 1, wherein the student machine learning model comprises a neuralnetwork model.
 5. The method of claim 1, wherein the student machinelearning model has fewer model parameters than the teacher machinelearning model.
 6. The method of claim 1, wherein for each traininginput of the set of multiple training inputs, the output generated bystudent machine learning model for the training input comprises arespective output score for each of the plurality of classes, whereineach output score satisfies:$q_{i}^{s} = \frac{\exp\left( \frac{z_{i}^{s}}{T^{s}} \right)}{\sum\limits_{j}{\exp\left( \frac{z_{j}^{s}}{T^{s}} \right)}}$wherein q_(i) ^(s) is the output score for a class i, z_(i) ^(s) is anintermediate score generated by the student machine learning model forclass i, z_(j) ^(s) is an intermediate score generated by the studentmachine learning model for class j, j ranges from 1 to a total number ofclasses in the plurality of classes, and T^(s) is a temperature constanthaving a value that is greater than
 1. 7. The method of claim 1, furthercomprising training the student machine learning model to, for one ormore training inputs of the set of multiple training inputs, process thetraining input to generate an output that matches a hard output for thetraining input, wherein the hard output comprises a respective hardscore for each of the plurality of classes, wherein the hard score for atarget class of the plurality of classes is equal to 1 and the hardscore for each remaining class of the plurality of classes is equal to0.
 8. A system comprising: one or more computers; and one or morestorage devices communicatively coupled to the one or more computers,wherein the one or more storage devices store instructions that, whenexecuted by the one or more computers, cause the one or more computersto perform operations for training a student machine learning modelhaving a plurality of student model parameters on a set of multipletraining inputs, wherein the student machine learning model isconfigured to process an input to generate an output that comprises arespective score for each of a plurality of classes, the methodcomprising: processing each training input of the set of multipletraining inputs using a teacher machine learning model to generate atarget output for the training input, wherein the target outputcomprises a respective target score for each of the plurality ofclasses, wherein each target score satisfies:$q_{i}^{t} = \frac{\exp\left( \frac{z_{i}^{t}}{T^{t}} \right)}{\sum\limits_{j}{\exp\left( \frac{z_{j}^{t}}{T^{t}} \right)}}$wherein q_(i) ^(t) is the target score for a class l, z_(i) ^(t) is anintermediate score generated by the teacher machine learning model forclass i, z_(j) ^(t) is an intermediate score generated by the teachermachine learning model for class j, j ranges from 1 to a total number ofclasses in the plurality of classes, and T^(t) is a temperature constanthaving a value that is greater than 1; and training the student machinelearning model to, for each training input of the set of multipletraining inputs, process the training input to generate an output thatmatches the target output generated by the teacher machine learningmodel for the training input.
 9. The system of claim 8, wherein theteacher machine learning model is an ensemble model comprising aplurality of respective baseline machine learning models.
 10. The systemof claim 9, wherein processing a training input using the teachermachine learning model to generate a target output for the traininginput comprises: processing the training input using each baselinemachine learning model to generate a baseline output for the traininginput; and combining the baseline outputs for the training inputs togenerate the target output for the training input.
 11. The system ofclaim 8, wherein the student machine learning model comprises a neuralnetwork model.
 12. The system of claim 8, wherein the student machinelearning model has fewer model parameters than the teacher machinelearning model.
 13. The system of claim 8, wherein for each traininginput of the set of multiple training inputs, the output generated bystudent machine learning model for the training input comprises arespective output score for each of the plurality of classes, whereineach output score satisfies:$q_{i}^{s} = \frac{\exp\left( \frac{z_{i}^{s}}{T^{s}} \right)}{\sum\limits_{j}{\exp\left( \frac{z_{j}^{s}}{T^{s}} \right)}}$wherein q_(i) ^(s) is the output score for a class i, z_(i) ^(s) is anintermediate score generated by the student machine learning model forclass i, z_(j) ^(s) is an intermediate score generated by the studentmachine learning model for class j, j ranges from 1 to a total number ofclasses in the plurality of classes, and T^(s) is a temperature constanthaving a value that is greater than
 1. 14. The system of claim 8,wherein the operations further comprise training the student machinelearning model to, for one or more training inputs of the set ofmultiple training inputs, process the training input to generate anoutput that matches a hard output for the training input, wherein thehard output comprises a respective hard score for each of the pluralityof classes, wherein the hard score for a target class of the pluralityof classes is equal to 1 and the hard score for each remaining class ofthe plurality of classes is equal to
 0. 15. One or more non-transitorycomputer storage media storing instructions that when executed by one ormore computers cause the one or more computers to perform operations fortraining a student machine learning model having a plurality of studentmodel parameters on a set of multiple training inputs, wherein thestudent machine learning model is configured to process an input togenerate an output that comprises a respective score for each of aplurality of classes, the method comprising: processing each traininginput of the set of multiple training inputs using a teacher machinelearning model to generate a target output for the training input,wherein the target output comprises a respective target score for eachof the plurality of classes, wherein each target score satisfies:$q_{i}^{t} = \frac{\exp\left( \frac{z_{i}^{t}}{T^{t}} \right)}{\sum\limits_{j}{\exp\left( \frac{z_{j}^{t}}{T^{t}} \right)}}$wherein q_(i) ^(t) is the target score for a class i, z_(i) ^(t) is anintermediate score generated by the teacher machine learning model forclass i, z_(j) ^(t) is an intermediate score generated by the teachermachine learning model for class j, j ranges from 1 to a total number ofclasses in the plurality of classes, and T^(t) is a temperature constanthaving a value that is greater than 1; and training the student machinelearning model to, for each training input of the set of multipletraining inputs, process the training input to generate an output thatmatches the target output generated by the teacher machine learningmodel for the training input.
 16. The non-transitory computer storagemedia of claim 15, wherein the teacher machine learning model is anensemble model comprising a plurality of respective baseline machinelearning models.
 17. The non-transitory computer storage media of claim16, wherein processing a training input using the teacher machinelearning model to generate a target output for the training inputcomprises: processing the training input using each baseline machinelearning model to generate a baseline output for the training input; andcombining the baseline outputs for the training inputs to generate thetarget output for the training input.
 18. The non-transitory computerstorage media of claim 15, wherein the student machine learning modelcomprises a neural network model.
 19. The non-transitory computerstorage media of claim 15, wherein the student machine learning modelhas fewer model parameters than the teacher machine learning model. 20.The non-transitory computer storage media of claim 15, wherein for eachtraining input of the set of multiple training inputs, the outputgenerated by student machine learning model for the training inputcomprises a respective output score for each of the plurality ofclasses, wherein each output score satisfies:$q_{i}^{s} = \frac{\exp\left( \frac{z_{i}^{s}}{T^{s}} \right)}{\sum\limits_{j}{\exp\left( \frac{z_{j}^{s}}{T^{s}} \right)}}$wherein q_(i) ^(s) is the output score for a class i, z_(i) ^(s) is anintermediate score generated by the student machine learning model forclass i, z_(j) ^(s) is an intermediate score generated by the studentmachine learning model for class j, j ranges from 1 to a total number ofclasses in the plurality of classes, and T^(s) is a temperature constanthaving a value that is greater than 1.